export interface BorrowRecord {
  id: number;
  userid: number;
  username: string;
  materialId: number;
  materialName: string;
  borrowDate: string; // YYYY-MM-DD
  expectedReturn: string; // YYYY-MM-DD
  actualReturn?: string; // YYYY-MM-DD
  status: string;
  purpose: string;
  createTime: string; // ISO格式
  updateTime: string; // ISO格式
  overdue: boolean;
  overdueDays: number;
  borrowDuration: number;
}

export interface CreateBorrowRequest {
  userid?: number;
  userId?: number;
  materialId?: number;
  materialID?: number;
  borrower?: string;
  item?: string;
  username?: string;
  userName?: string;
  materialName?: string;
  material?: string;
  borrowDate?: string;
  date?: string;
  expectedReturn?: string;
  purpose?: string;
  status?: string;
  actualReturn?: string;
  createTime?: string;
  updateTime?: string;
}

export interface UpdateBorrowRequest {
  // 归还操作
  action?: 'return';
  actualReturn?: string;
  status?: string;

  // 延长借用时间
  newExpectedReturn?: string;
  extendDays?: number;

  // 普通更新
  expectedReturn?: string;
  purpose?: string;
  username?: string;
  userName?: string;
  materialName?: string;
}

export interface BorrowQueryParams {
  userid?: number;
  userId?: number;
  materialId?: number;
  status?: string;
}

export interface ReturnBorrowRequest {
  actualReturn?: string;
}